package com.xuecheng.media.config;

import io.minio.MinioClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Minio配置
 *
 * @author Mr.M
 * @version 1.0
 * @date 2023/2/17 15:00
 */
@Configuration
public class MinioConfig {
    //@Value("${minio.endpoint:http://192.168.101.65:9000}")
    private String endpoint = "http://192.168.101.65:9000";
    //@Value("${minio.accessKey:minioadmin}")
    private String accessKey = "minioadmin";
    //@Value("${minio.secretKey:minioadmin}")
    private String secretKey = "minioadmin";

    @Bean
    public MinioClient minioClient() {

        MinioClient minioClient =
                MinioClient.builder()
                        .endpoint(endpoint)
                        .credentials(accessKey, secretKey)
                        .build();
        return minioClient;
    }


}
